<?php
include ("boot.php");

// ==========================================================================
// User Class
// ==========================================================================

$oADODB->debug = true;

$oLink = new daoLinks($oADODB);
$oLink->clean();

// removes slashes
$sViewdb = stripslashes($_GET['viewdb']);
// decode json recieved from Bindows to Array
$aRequest = json_decode($sViewdb, true);
// link
$aRequestRel['vLnkName'] = $aRequest['vLnkNameLink'];
$aRequestRel['vURL'] = str_replace("http://", "", $aRequest['vURL']);
$aRequestRel['iSocialID'] = $aRequest['iSocialID'];

// check if the social url already exists
$oLink->addFilter("vURL", "=",  $aRequestRel['vURL']);
$oLink->addFilter("iSocialID", "<>",  "");
if ($oLink->getAll()->EOF) $oLink->save($aRequestRel);
?>